<%-- 
    Document   : EditCustomer
    Created on : Jul 30, 2012, 11:24:18 AM
    Author     : RasJLK
--%>

<%@page import="ejb.Customer"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Add/Edit Customer</title>
        <link rel="stylesheet" type="text/css" href="style.css" media="screen" />
    </head>
    <body>
        <%
         Customer c =(Customer) request.getAttribute("customer");
        %>
        <form method="POST" action="AddCustomer">
            <table>
                <caption>Customer Details</caption>
                <tr>
                    <td>Customer Id:</td><td> <input type="text" name="id"  value="<%= c != null ? c.getId() : ""%>" /></td>
                </tr>
                <tr>
                    <td>Name:</td><td> <input type="text" name="name"  value="<%= c != null ? c.getName() : "" %>" /></td>
                </tr>
                <tr>
                    <td>Address:</td><td><textarea name="address" class="big" multiple="multiple"><%= c != null ? c.getAddress() : ""  %></textarea></td>
                </tr>
                <tr>
                    <td>Contact No:</td><td> <input type="text" name="contact"  value="<%= c != null ? c.getContactNo() : ""  %>" /></td>
                </tr>
                <tr>
                    <td colspan="2"><input type="Submit"  value="Add/Update Customer" />
                    <a href="CustomerList">View Customers</a> </td>
                </tr>
            </table>
           
        </form>
        
    </body>
</html>
